<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
       /*  function getsum(num){
            var sum = 0 ;
            for(var i = 1; i <= num; i++){
                sum += i;
            }
            alert(sum);
        }

        getsum(100);
        getsum(200); */

        /* function getsum (m, n){
            var sum = 0;
            for(var i = m; i <= n; i++){
                sum += i;
            }
            alert(sum);
        }

        getsum(23, 100); */

        function aa(arr){
            // var arr = ['一', '二', '三', '四'];
            var arr2 = [];
            for(var i = arr.length - 1; i >=0 ; i--){
                arr2[arr2.length] = arr[i];
            }
            console.log(arr2);
        } 
        aa(['一', '二', '三', '四']);
        aa([5, 4, 3, 2, 1]);
    </script>
</body>
</html>